package com.dries.portal.app.controller;

import com.dries.portal.app.entity.CustomerLogin;
import com.dries.portal.app.service.ICustomerLoginService;
import com.dries.security.common.api.CommonResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Map;

/**
 * 
 *
 * @author dries
 * @email samphsanie@gmail.com
 * @date 2020-09-03 09:35:23
 */
@RestController
@RequestMapping("app/customer/login")
public class CustomerLoginController {

    @Resource
    private ICustomerLoginService customerLoginService;

    /**
     * 列表
     */
    @GetMapping("/list")
    public CommonResult list(@RequestParam Map<String, Object> params){

        
        return CommonResult.success();
    }


    /**
     * 信息
     */
    @GetMapping("/info/{customerId}")
    public CommonResult info(@PathVariable("customerId") Integer customerId){
		CustomerLogin customerLogin = customerLoginService.getById(customerId);
        return CommonResult.success();
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public CommonResult save(@RequestBody CustomerLogin customerLogin){
		customerLoginService.save(customerLogin);

        return CommonResult.success();
    }

    /**
     * 修改
     */
    @PutMapping("/update")
    public CommonResult update(@RequestBody CustomerLogin customerLogin){
		customerLoginService.updateById(customerLogin);

        return CommonResult.success();
    }

    /**
     * 删除
     */
    @DeleteMapping("/delete")
    public CommonResult delete(@RequestBody Integer[] customerIds){
		customerLoginService.removeByIds(Arrays.asList(customerIds));

        return CommonResult.success();
    }

}
